package com.zhuo.schoolproject.controller;

import cn.dev33.satoken.stp.StpUtil;
import cn.dev33.satoken.util.SaResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/hello/")
public class HelloController {
    @GetMapping
    public SaResult hello(){
        // 获取当前登录用户信息
        Object loginId = StpUtil.getLoginId();
        return SaResult.ok("Hello World - 用户ID: " + loginId);
    }
}
